﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Transactions;
using T.FAS.Runtime.Base.Common;
using T.FAS.Runtime.Base.Dao;
using T.FAS.Runtime.Base.Entity;

namespace T.FAS.Runtime.Base.Service
{
    public class FASAuthService
    {
        private readonly FASAuthResultDao _fASAuthResultDao = new FASAuthResultDao();

        public bool AuthUser(AuthServiceParam queryParam)
        {
            queryParam.UserID = UserUtil.GetCurrentUserID();
            return _fASAuthResultDao.AuthUser(queryParam);
        }

        /// <summary>
        /// 获取
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public List<FASAuthResult> GetFASAuthResultByFilter(AuthServiceParam queryParam)
        {
            return _fASAuthResultDao.GetFASAuthResultByFilter(queryParam);
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="authResult"></param>
        public void BatchCreateFASAuthResults(List<FASAuthResult> authResult)
        {
            _fASAuthResultDao.BatchCreateFASAuthResults(authResult);
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="filter"></param>
        public void DeleteFASAuthResultByFilter(AuthServiceParam queryParam)
        {
            _fASAuthResultDao.DeleteFASAuthResultByFilter(queryParam);
        }
    }
}
